/**
 * 
 */
package com.ws.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zhong
 *
 */
@WebServlet(value="/login")
public class LoginServlet extends HttpServlet {

	
		/**  描述   (@author: yuanzhong) */      
	    
	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		
		String userName = req.getParameter("userName");
		
		req.getSession().setAttribute("userName", userName);
		
		System.out.println("====== userName:"+userName);
		
		resp.sendRedirect("index.jsp");
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		
		
		super.doPost(req, resp);
	}
	

}
